var app = {
	description : 'App Common JS Library',
	version : '0.0.1'
};

app.login = {
	doLogin : function($form, callback) {
		var username = $form.find('input[id=username]').val();
		var password = $form.find('input[id=password]').val();
		$.ajax({
			type: "POST",
			url: webroot + "/system/userLogin",
			data: {
    	 		username:username, 
    	 		password:password
    	 	},
     		dataType: "json",
     		success: function(resp){
				if(resp.success){
					if (resp.content && resp.content.redirect) {
						location.href = webroot + resp.content.redirect;
					}
				} else {
					alert(resp.message);
				}
        	}
         });
	}
}